home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 33
/
Volume 33 - JOGO DISK .iso
/
Games
/
pin_ball_deluxe.swf
/
scripts
/
DefineSprite_421
/
frame_1
/
DoAction_2.as
next >
Wrap
Text File
|
2007-01-15
|
8KB
|
252 lines
function findPossibleSegmentTarget()
{
antSeg = segmentT;
_root.ballrightBumper = false;
_root.ballleftBumper = false;
_root.ballrightTargetBlock = false;
_root.ballleftTargetBlock = false;
_root.ballrightFlipper = false;
_root.ballleftFlipper = false;
_root.ballrightRamp2 = false;
_root.ballleftRamp2 = false;
_root.ballrightRamp1 = false;
_root.ballleftRamp1 = false;
tempSegments = new Array();
if(_root.ballrightBumper != true && _root.ballrightTargetBlock != true && _root.ballleftTargetBlock != true && _root.ballrightFlipper != true && _root.ballleftFlipper != true && _root.ballrightRamp2 != true && _root.ballleftRamp2 != true && _root.ballrightRamp1 != true && _root.ballleftRamp1 != true)
{
for(var _loc5_ in _root.splitSegment1)
{
if(_root.splitSegment1[_loc5_].isPossibleTarget(this))
{
tempSegments[tempSegments.length] = _root.splitSegment1[_loc5_];
}
}
}
if(this._x > _root.tbRLine._x)
{
for(_loc5_ in _root.splitSegment6)
{
if(_root.splitSegment6[_loc5_].isPossibleTarget(this))
{
tempSegments[tempSegments.length] = _root.splitSegment6[_loc5_];
}
}
}
for(_loc5_ in _root.splitSegment2)
{
if(_root.splitSegment2[_loc5_].isPossibleTarget(this))
{
tempSegments[tempSegments.length] = _root.splitSegment2[_loc5_];
}
}
if(this._y > _root.brTLine._y)
{
if(this._x > _root.brRLine2._x)
{
if(this._x < _root.brRLine1._x)
{
_root.ballrightBumper = true;
for(_loc5_ in _root.splitSegment3)
{
if(_root.splitSegment3[_loc5_].isPossibleTarget(this))
{
tempSegments[tempSegments.length] = _root.splitSegment3[_loc5_];
}
}
}
}
}
if(this._y < _root.topBLine._y)
{
for(_loc5_ in _root.splitSegment4)
{
if(_root.splitSegment4[_loc5_].isPossibleTarget(this))
{
tempSegments[tempSegments.length] = _root.splitSegment4[_loc5_];
}
}
for(_loc5_ in _root.splitSegment5)
{
if(_root.splitSegment5[_loc5_].isPossibleTarget(this))
{
tempSegments[tempSegments.length] = _root.splitSegment5[_loc5_];
}
}
}
if(this._y > _root.ramp2T._y)
{
if(this._y < _root.ramp2B._y)
{
if(this._x > _root.ramp2L1._x)
{
if(this._x < _root.ramp2L2._x)
{
_root.ballleftRamp2 = true;
for(_loc5_ in _root.splitSegment7)
{
if(_root.splitSegment7[_loc5_].isPossibleTarget(this))
{
tempSegments[tempSegments.length] = _root.splitSegment7[_loc5_];
}
}
for(_loc5_ in _root.splitSegment11)
{
if(_root.splitSegment11[_loc5_].isPossibleTarget(this))
{
tempSegments[tempSegments.length] = _root.splitSegment11[_loc5_];
}
}
for(_loc5_ in _root.splitSegment17)
{
if(_root.splitSegment17[_loc5_].isPossibleTarget(this))
{
tempSegments[tempSegments.length] = _root.splitSegment17[_loc5_];
}
}
}
}
if(this._x > _root.ramp2R2._x)
{
if(this._x < _root.ramp2R1._x)
{
_root.ballrightRamp2 = true;
for(_loc5_ in _root.splitSegment9)
{
if(_root.splitSegment9[_loc5_].isPossibleTarget(this))
{
tempSegments[tempSegments.length] = _root.splitSegment9[_loc5_];
}
}
for(_loc5_ in _root.splitSegment12)
{
if(_root.splitSegment12[_loc5_].isPossibleTarget(this))
{
tempSegments[tempSegments.length] = _root.splitSegment12[_loc5_];
}
}
}
}
}
}
if(this._y > _root.ramp1T._y)
{
if(this._y < _root.ramp1B._y)
{
if(this._x > _root.ramp1L1._x)
{
if(this._x < _root.ramp1L2._x)
{
_root.ballleftRamp1 = true;
for(_loc5_ in _root.splitSegment8)
{
if(_root.splitSegment8[_loc5_].isPossibleTarget(this))
{
tempSegments[tempSegments.length] = _root.splitSegment8[_loc5_];
}
}
}
}
if(this._x > _root.ramp1R2._x)
{
if(this._x < _root.ramp1R1._x)
{
_root.ballrightRamp1 = true;
for(_loc5_ in _root.splitSegment10)
{
if(_root.splitSegment10[_loc5_].isPossibleTarget(this))
{
tempSegments[tempSegments.length] = _root.splitSegment10[_loc5_];
}
}
}
}
}
}
if(this._y > _root.frTLine._y)
{
if(this._y < _root.frBLine._y)
{
if(this._x > _root.frLLine1._x)
{
if(this._x < _root.frLLine2._x)
{
_root.ballleftFlipper = true;
for(_loc5_ in _root.splitSegment16)
{
if(_root.splitSegment16[_loc5_].isPossibleTarget(this))
{
tempSegments[tempSegments.length] = _root.splitSegment16[_loc5_];
}
}
}
}
if(this._x > _root.frRLine2._x)
{
if(this._x < _root.frRLine1._x)
{
_root.ballrightFlipper = true;
for(_loc5_ in _root.splitSegment15)
{
if(_root.splitSegment15[_loc5_].isPossibleTarget(this))
{
tempSegments[tempSegments.length] = _root.splitSegment15[_loc5_];
}
}
}
}
}
}
if(this._y > _root.tbTLine._y)
{
if(this._y < _root.tbBLine._y)
{
if(this._x > _root.tbRLine._x)
{
_root.ballrightTargetBlock = true;
for(_loc5_ in _root.splitSegment13)
{
if(_root.splitSegment13[_loc5_].isPossibleTarget(this))
{
tempSegments[tempSegments.length] = _root.splitSegment13[_loc5_];
}
}
}
else if(this._x < _root.tbLLine._x)
{
_root.ballleftTargetBlock = true;
for(_loc5_ in _root.splitSegment14)
{
if(_root.splitSegment14[_loc5_].isPossibleTarget(this))
{
tempSegments[tempSegments.length] = _root.splitSegment14[_loc5_];
}
}
}
}
}
if(tempSegments.length == 1)
{
segmentT = tempSegments[0];
return undefined;
}
segMinDistance = 100000;
var _loc4_ = -1;
for(_loc5_ in tempSegments)
{
var _loc3_ = tempSegments[_loc5_].cachedDistance;
if(_loc3_ < segMinDistance && (_loc3_ > 0 || segmentT == tempSegments[_loc5_] || tempSegments[_loc5_].isCrossed))
{
segMinDistance = _loc3_;
_loc4_ = _loc5_;
}
}
if(_loc4_ != -1)
{
segmentT = tempSegments[_loc4_];
}
else
{
segmentT = null;
}
}